Raw image format

Raw image file
Filename extension .3fr (Hasselblad)
.ari (ARRIFLEX)
.arw .srf .sr2
 (Sony)
.bay (Casio)
.crw .cr2 (Canon)
.cap .iiq .eip
 (Phase_One)
.dcs .dcr .drf .k25 .kdc (Kodak)
.dng (Adobe)
.erf (Epson)
.fff (Imacon)
.mef (Mamiya)
.mos (Leaf)
.mrw (Minolta)
.nef .nrw (Nikon)
.orf (Olympus)
.ptx .pef (Pentax)
.pxn (Logitech)
.R3D (RED)
.raf (Fuji)
.raw .rw2 (Panasonic)
.raw .rwl .dng (Leica)
.rwz (Rawzor)
.x3f (Sigma)
Type of format Image file formats

A camera raw image file contains minimally processed data from the image sensor of either a digital camera, image, or motion picture film scanner. Raw files are so named because they are not yet processed and therefore are not ready to be printed or edited with a bitmap graphics editor. Normally, the image is processed by a raw converter in a wide-gamut internal colorspace where precise adjustments can be made before conversion to a "positive" file format such as TIFF or JPEG for storage, printing, or further manipulation, which often encodes the image in a device-dependent colorspace. These images are often described as "RAW image files" based on the erroneous belief that they represent a single file format. In fact there are dozens if not hundreds of raw image formats in use by different models of digital equipment (like cameras or film scanners).[1]

Raw image files are sometimes called digital negatives, as they fulfill the same role as negatives in film photography: that is, the negative is not directly usable as an image, but has all of the information needed to create an image. Likewise, the process of converting a raw image file into a viewable format is sometimes called developing a raw image, by analogy with the film development process used to convert photographic film into viewable prints. The selection of the final choice of image rendering is part of the process of white balancing and color grading.

Like a photographic negative, a raw digital image may have a wider dynamic range or color gamut than the eventual final image format, and it preserves most of the information of the captured image. The purpose of raw image formats is to save, with minimum loss of information, data obtained from the sensor, and the conditions surrounding the capturing of the image (the metadata).

Contents

Rationale

Providing a detailed and concise description of the content of raw files is highly problematic. There is no single raw format; formats can be similar or radically different. Different manufacturers use their own proprietary and typically undocumented formats, which are collectively known as raw format. Often they also change the format from one camera model to the next. Several major camera manufacturers, including Nikon, Canon and Sony, encrypt portions of the file in an attempt to prevent third-party tools from accessing them.[2]

This industry-wide situation of inconsistent formatting has concerned many photographers who worry that their valuable raw photos may someday become inaccessible, as computer operating systems and software programs become obsolete and abandoned raw formats are dropped from new software. The availability of high-quality open source software which decodes raw image formats, particularly dcraw, has helped to alleviate these concerns. An essay by Michael Reichmann and Juergen Specht stated "here are two solutions – the adoption by the camera industry of A: Public documentation of RAW formats; past, present and future, or, more likely B: Adoption of a universal RAW format"; and included in its petition "I am also requesting that your company adopt a universal RAW format. The DNG format has been put forward as such a possible standard, but we are willing to accept any truly open standard as the industry may agree upon".[3] "Planning for [US] Library of Congress Collections" identifies RAW file formats as "less desirable file formats", and identifies DNG as a suggested alternative.[4]

DNG is the only raw image format for which industry-wide buy-in is being sought. It is based upon, and compatible with, the ISO standard raw image format ISO 12234-2, TIFF/EP, and is being used by ISO in their revision of that standard. (See the Standardization section, below.)

Raw image formats are intended to reproduce as closely as possible (i.e. at the best of the specific sensor's performance) the sensitometry of the image, that is, physical information about the light intensity and color of the scene.

Most raw image file formats store information sensed according to the geometry of the sensor's individual photo-receptive elements (sometimes called pixels), rather than points in the expected final image: sensors with hexagonal element displacement, for example, record information for each of their hexagonally-displaced cells, which a decoding software will eventually transform into the rectangular geometry during "digital developing".

File contents

Raw files contain, by necessity, the information required to produce a viewable image from the camera's sensor data. The structure of raw files, including the ISO standard raw image format ISO 12234-2, TIFF/EP, often follows a common pattern, that is:

Many raw file formats (including 3FR (Hasselblad), DCR, K25, KDC (Kodak), CR2 (Canon), ERF (Epson), MEF (Mamiya), MOS (Leaf), NEF (Nikon), ORF (Olympus), PEF (Pentax), RW2 (Panasonic) and ARW, SRF, SR2 (Sony)) are based on the TIFF file format.[5] These files may deviate from the TIFF standard in a number of ways, including the use of a non-standard file header, the inclusion of additional image tags and the encryption of some of the tagged data.

Panasonic's raw converter corrects geometric distortion and chromatic aberration on such cameras as the LX3,[6][7][8] with necessary correction information presumably included in the raw.

DNG, the Adobe digital negative format, is an extension of the TIFF 6.0 format and is compatible with TIFF/EP, and uses various open formats and/or standards, including Exif metadata, XMP metadata, IPTC metadata, CIE XYZ coordinates, ICC profiles, and JPEG.[9]

Sensor image data

In digital photography, the Raw file plays the role that photographic film plays in film photography. Raw files thus contain the full resolution (typically 12- or 14-bit) data as read out from each of the camera's image sensor pixels.

The camera's sensor is almost invariably overlaid with a color filter array, usually a Bayer filter, consisting of a mosaic of a 2x2 matrix of red, green, blue and (second) green filters.

One variation on the Bayer filter is the RGBE filter of the Sony Cyber-shot DSC-F828, which exchanged the green in the RG rows with "emerald"[10] (a blue-green[11] or cyan[12] color). Other sensors, such as the Foveon X3 sensor, capture information directly in RGB form, having three pixel sensors in each location, one for each color component; these camera RGB raw data still need to be processed to make an image file, as the RGB values correspond to the responses of the sensors, not to a standard color space like sRGB, though they do not need to be demosaiced.

Flatbed and film scanner sensors are typically straight narrow RGB or RGBI (where "I" is infrared) strips that are swept across an image. The HDRi raw data format is able to store the infrared raw data, which can be used for Infrared cleaning, as an additional 16bit channel. The remainder of the discussion about raw files applies to them as well. (Some scanners do not allow the host system access to the raw data at all, as a speed compromise. The raw data are processed very rapidly inside the scanner to select out the best part of the available dynamic range so only the result is passed to the computer for permanent storage, reducing the amount of data transferred and therefore the bandwidth requirement for any given speed of image throughput.)

To obtain an image from a Raw file, this mosaic of data must be converted into standard RGB form. This is often referred to as "raw development."

When converting from the 4 sensor 2x2 Bayer Matrix Raw form into single RGB pixels the original 4 x 12 (or 14) bit data is reduced to 3 x 8 bit. The Green pair is used to control the overall luminance of the processed output pixel (since the human eye is more sensitive to it - and so Green is used as the dominant channel for in-camera black-and-white conversions).

Note that many non-DSLR camera's also perform some degree of spacial processing in order to correct for lens distortion (especially Barrel & Pincushion) [13].

If Raw format data is available, it can be used in High dynamic range imaging conversion (instead of the 'standard' HDI approach of exposing 3 separate images, one under exposed, one correct and one over-exposed, and 'overlaying' one on top of the other).

Benefits

Nearly all digital cameras can process the image from the sensor into a JPEG file using settings for white balance, color saturation, contrast, and sharpness that are either selected automatically or entered by the photographer before taking the picture. Cameras that produce raw files save these settings in the file, but defer the processing. This results in an extra step for the photographer, so raw is normally only used when additional computer processing is intended. However, raw has numerous advantages over JPEG such as:

Drawbacks

Software support

Cameras that support raw files typically come with proprietary software for conversion of their raw image data into standard RGB images. Other processing and conversion programs and plugins are available from vendors that have either licensed the technology from the camera manufacturer or reverse-engineered the particular raw format and provided their own processing algorithms.

Adobe Photoshop contains extensive support of raw formats since version CS2, as does Adobe Photoshop Lightroom.

Microsoft's Digital Image 2006 recognizes and organizes raw image formats such as.crw, .cr2, and.nef, which are file formats produced by Canon and Nikon, but that product was discontinued in 2007.[18]

Microsoft supplies free software for Windows XP to integrate viewing and printing into the system's other photo tools; however, this software was last updated in 2005 and does not support many raw files from cameras released subsequently.[19]

Windows XP and Vista both support the WIC codec standard. Products such as Windows Photo Gallery, Windows Live Photo Gallery and FastPictureViewer Professional[20] can view raw formats for which the necessary WIC codecs are installed. Camera manufacturers Canon, Nikon, Sony, Olympus and Pentax have released WIC codecs, although some manufactures are only providing codec support for the 32-bit versions of Vista.[21] A commercial DNG codec is also available from Ardfry Imaging,[22] while the makers of FastPictureViewer have released a WIC codec pack, adding support for 22 raw formats to Windows in both 32-bit and 64-bit versions, as donationware.[23]

In 2005, Apple Computer introduced several products which offered raw file support. In January, Apple released iPhoto 5, which offered basic support for viewing and editing many raw file formats. In April, Apple introduced a new version of its operating system, Mac OS X v10.4, which added raw support directly to the operating system, as part of the ImageIO framework, which adds raw support automatically to the majority of Mac OS X applications both from Apple (such as Preview, Mac OS X's PDF and image viewing application and Aperture, a photo post-production software package for professionals) as well as all third party applications which make use of the ImageIO frameworks. Semi-regular updates to OS X generally include updated support for new raw file formats introduced in the intervening months by camera makers.

There are many other "raw workflow applications" designed to provide efficient processing and post-processing of raw images, including Helicon Filter, Phase One's Capture One, DxO Labs' DxO Optics Pro and Bibble Labs' Bibble Pro. Like Apple Aperture, Adobe Photoshop and Lightroom, LaserSoft Imaging's SilverFast, and PhotoLine, these programs provide sophisticated controls for processing the information stored in the raw file and converting raw files to JPEG or TIFF. Picasa, a free image editing and cataloguing program from Google, can read and display many raw formats, but like iPhoto, Picasa provides only limited tools for processing the data in a raw file.

A portable open source program, dcraw, supports most raw formats and can be made to run on operating systems not supported by most commercial software (such as Unix). Libraw is an API library based on dcraw, offering a more convenient interface for reading and converting raw files. Libraw lite is a subset of Libraw released under GNU Lesser GPL to allow the use in commercial applications. HDR PhotoStudio and AZImage are some of the commercial applications that use Libraw Lite. Jrawio is another API library, written in pure Java code and compliant to the standard Java Image I/O API.

RawTherapee is an open source raw converter supporting the Windows and Linux operating systems.

Darktable is an open source RAW workflow tool for Linux and other open unix-like operating systems.

UFRaw is free software based on dcraw. It can be used as a GIMP plugin and is available for most operating systems.

The latest version of GIMP, a free open source photo editing package, imports many raw formats. Older versions have a plug-in which allows it to read and convert raw files.

ExifTool supports the reading, writing and editing of metadata in raw image files. ExifTool supports many different types of metadata including Exif, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the maker notes of many digital cameras.

Light Crafts' LightZone photo editing software provides the ability to edit many raw formats natively. Most tools are raw converters, but LightZone allows a user to edit a raw file as if it were TIFF or JPEG.

Standardization

The ISO standard raw image format is ISO 12234-2, better known as TIFF/EP. (TIFF/EP also supports "non-raw", or "processed", images). TIFF/EP provided a basis for the raw image formats of a number of cameras. For example, Nikon's NEF raw files are based on TIFF/EP, and include a tag which identifies the version of TIFF/EP they are based on.[24] Adobe's DNG (Digital Negative) raw file format was based on TIFF/EP, and the DNG specification states "DNG ... is compatible with the TIFF-EP standard".[25] Several cameras use DNG as their raw image format, so in that limited sense they use TIFF/EP too.[26]

Adobe Systems launched this DNG raw image format in September 2004. By September 2006, several camera manufacturers had started to announce support for DNG in newer camera models, including Leica, Samsung, Ricoh, Pentax, Hasselblad (native camera support); and Hasselblad, Better Light (export).[27] The Leica Digital-Modul-R (DMR) was first to use DNG as its native format.[28] In September 2009 Adobe stated that there were no known intellectual property encumbrances or license requirements for DNG.[29] (There is a "Digital Negative (DNG) Specification Patent License",[30] but it does not actually state that there are any patents held on DNG, and the September 2009 statement was made at least 4 years after this License was published).

TIFF/EP began its 5-year revision cycle in 2006.[31] Adobe offered the DNG specification to ISO to be part of ISO's revised TIFF/EP standard.[32][33] A progress report in October 2008 from ISO about the revision of TIFF/EP stated that the revision "... currently includes two "interoperability-profiles," "IP 1" for processed image data, using ".TIF" extension, and "IP 2" for "raw" image data, ".DNG" extension".[34] It is "IP 2" that is relevant here. A progress report in September 2009 states that "This format will be similar to DNG 1.3, which serves as the starting point for development."[35]

DNG has been exploited by open-source developers.[2] Use by camera makers varies: the largest companies such as Canon, Nikon, Sony, and some others, don't use DNG; but smaller companies, and makers of "niche" cameras who might otherwise have difficulty getting support from software companies, frequently use DNG as their native raw image format. (Or in the case of Pentax, as an optional alternative to their own raw image format). There are of the order of 15 or more such companies, even including a few that specialize in movie cameras.[26]

Processing

To be viewed or printed, the output from a camera's image sensor has to be processed, that is, converted to a photographic rendering of the scene, and then stored in a standard raster graphics format such as JPEG. This processing, whether done in-camera or later in a raw file converter, involves a number of operations, typically including:[36][37]

Note that demosaicing is only performed for CFA sensors; it is not required for 3CCD or Foveon X3 sensors.

Cameras and image processing software may also perform additional processing to improve image quality, for example:

When a camera saves a raw file it defers most of this processing; typically the only processing performed is the removal of defective pixels (the DNG specification requires that defective pixels are removed before creating the file[38]). Some camera manufacturers do additional processing before saving raw files; for example, Nikon has been criticized by astrophotographers for applying noise reduction before saving the raw file.[39]

Some raw formats also allow nonlinear quantization.[15][16] This nonlinearity allows the compression of the raw data without visible degradation of the image by removing invisible and irrelevant information from the image. Although noise is discarded this has nothing to do with (visible) noise reduction.

See also

References

  1. Decoding raw digital photos in Linux
  2. 2.0 2.1 "Raw storm in a teacup?". Dpreview.com. 2005-04-27. http://www.dpreview.com/news/0504/05042701davecoffininterview.asp. Retrieved 2007-12-09.  Dave Coffin, creator of the dcraw program, discusses some of his successful reverse-engineering in this interview, and mentions his enthusiasm for the DNG format.
  3. The Luminous Landscape: The RAW Flaw by Michael Reichmann and Juergen Specht
  4. Planning for US Library of Congress Collections: Preferences in Summary
  5. "Exif Tool, Supported File Types". http://www.sno.phy.queensu.ca/~phil/exiftool/#supported. 
  6. The Online Photographer: Panasonic LX3 Barrel Distortion Controversy
  7. Panasonic LX3 Lens Distortion
  8. [1]
  9. Adobe: DNG Specification
  10. "Sony 4 colour (RGB-E) filter on DSC-F828 sensor". http://www.sony.net/SonyInfo/News/Press_Archive/200307/03-029E/. 
  11. "Sony Japan announces new RGB+E image sensors". imaging-resource.com. July 16, 2003. http://www.imaging-resource.com/NEWS/1058329666.html. 
  12. "Sony announce new RGBE CCD". dpreview.com. 15 July 2003. http://www.dpreview.com/news/0307/03071601sonyrgbeccd.asp. 
  13. http://www.dpreview.com/articles/distortion/
  14. "Understanding Camera Raw". http://www.ineasysteps.com/resources/articles/read/?id=10. 
  15. 15.0 15.1 Digital Negative (DNG) Specification. pp. 61. http://www.adobe.com/products/dng/pdfs/dng_spec.pdf. 
  16. 16.0 16.1 "Is the Nikon D70 NEF (RAW) format truly lossless?". http://www.majid.info/mylos/weblog/2004/05/02-1.html. 
  17. Larry Strunk (2006-03-19). "The RAW Problem". OpenRAW. http://www.openraw.org/info/. 
  18. Microsoft Digital Image Home page
  19. Microsoft RAW Image Thumbnailer and Viewer for Windows XP
  20. FastPictureViewer's Image Formats Compatibility Chart
  21. Understanding RAW Image Support in Windows Vista: Windows Vista team blog
  22. DNG Thumbnail and Preview Support for Windows Photo Gallery and Windows Live Photo Gallery
  23. FastPictureViewer 32/64-bit raw codec pack for Windows
  24. Barry Pearson: What is in a raw file?
  25. Adobe: DNG 1.3.0.0 Specification (June 2009) (scroll down a bit)
  26. 26.0 26.1 Barry Pearson: Products from Camera Manufacturers that use DNG in some way
  27. Barry Pearson: DNG support, to end-September 2006
  28. Barry Pearson: A brief history of DNG
  29. Adobe Labs: CinemaDNG (final bullet point)
  30. Adobe: Digital Negative (DNG) Specification Patent License
  31. I3A (International Imaging Industry Association): WG18, Ad Hoc groups and JWG 20/22/23 Meet in Tokyo
  32. Web archive of widely distributed email: Forwarded Message from a member of the ISO TC42 (technical committee for photography) working group 18 (electronic imaging) standards group
  33. DPReview: Adobe seeks International recognition for DNG
  34. I3A (International Imaging Industry Association): ISO 12234 Part 2 – TIFF/EP (scroll down a bit)
  35. NPES: Minutes of ISO/TC 130/WG2, 39th Meeting, see 14f
  36. R. Ramanath, W.E. Snyder, Y. Yoo, M.S. Drew. Color Image Processing Pipeline in Digital Still Cameras. http://mysite.verizon.net/rajeevramanath/Research/pipeline-SPM-05.pdf. 
  37. Keigo Hirakawa. "Color Imaging Pipeline for Digital Still & Video Cameras Part 1: Pipeline and Color Processing". http://www.accidentalmark.com/research/tutorial/ICIP2008/Hirakawa08ICIPTutorial_Handout.pdf. 
  38. Digital Negative (DNG) Specification. pp. 14. http://www.adobe.com/products/dng/pdfs/dng_spec.pdf. 
  39. "Comparative test: Canon 10D / Nikon D70 in the field of deep-sky astronomy". http://astrosurf.com/buil/d70v10d/eval. 

External links